import request from '@/utils/request'

// 查询支付商户列表
export function listMerchant(query) {
  return request({
    url: '/cms/pay/merchant/list',
    method: 'get',
    params: query
  })
}

// 查询支付商户详细
export function getMerchant(id) {
  return request({
    url: '/cms/pay/merchant/' + id,
    method: 'get'
  })
}

// 查询支付商户详细
export function getMerchantByCode(code) {
  return request({
    url: '/cms/pay/merchant/getByCode/' + code,
    method: 'get'
  })
}

// 新增支付商户
export function addMerchant(data) {
  return request({
    url: '/cms/pay/merchant',
    method: 'post',
    data: data
  })
}

// 锁定支付商户
export function lockMerchant(id) {
  return request({
    url: '/cms/pay/merchant/lock/' + id,
    method: 'post'
  })
}

// 修改支付商户
export function updateMerchant(data) {
  return request({
    url: '/cms/pay/merchant',
    method: 'put',
    data: data
  })
}
// 修改支付商户
export function updateMerchantSync(data) {
  return request({
    url: '/cms/pay/merchant/syncEdit',
    method: 'put',
    data: data
  })
}

// 删除支付商户
export function delMerchant(id) {
  return request({
    url: '/cms/pay/merchant/' + id,
    method: 'delete'
  })
}
